/**
 * @公司:公约树
 * @位置:苏州
 * @Classname Anime04
 * @Date 2022-06-13 下午 12:01
 * @Created by hanWanLu
 * @auther 中文:韩万路
 */


package com.animeJavaExample;

import javafx.application.Application;
import javafx.beans.property.ObjectProperty;
import javafx.event.EventDispatcher;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

public class Anime04 extends Application {
    public static void main(String[] args) {
        launch(args);
    }
    @Override
    public void start(Stage stage) throws Exception {
        AnchorPane anchorPane = new AnchorPane();
        Scene scene = new Scene(anchorPane);
        stage.setScene(scene);
        stage.setHeight(400);
        stage.setWidth(400);
        stage.setAlwaysOnTop(true);
        stage.initStyle(StageStyle.TRANSPARENT);
        scene.setFill(null);
        anchorPane.setStyle("-fx-background-color: rgba(173,173,173,0)");

        anchorPane.setOnMousePressed(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                System.out.println("333");
            }
        });

        Button button1 = new Button("按钮1");
        anchorPane.getChildren().add(button1);
        button1.setPrefHeight(200);
        button1.setPrefWidth(200);
        button1.setDisable(false);
        button1.setOpacity(1);
        Button button2 = new Button("按钮2");
        anchorPane.getChildren().add(button2);
        button2.setPrefHeight(200);
        button2.setPrefWidth(200);
        button2.setLayoutY(50);
        button2.setLayoutX(50);

        button2.setDisable(true);
        button2.setOpacity(1);



        stage.show();

//        anchorPane.setDisable(true);
//        anchorPane.setOpacity(1);

//        scene.setEventDispatcher();
        ObjectProperty<EventDispatcher> eventDispatcherObjectProperty = scene.eventDispatcherProperty();
//        eventDispatcherObjectProperty.

    }
}
